Skip to content

Instantly share code, notes, and snippets.

@sumitkharche
Created January 10, 2020 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sumitkharche/aaaf8d7e78454a34a86de614bfe0a086 to your computer and use it in GitHub Desktop.
Save sumitkharche/aaaf8d7e78454a34a86de614bfe0a086 to your computer and use it in GitHub Desktop.
AutoMapperProfile.cs for nested class
using AutoMapper;
namespace automapper_sample
{
public class AutoMapperProfile : Profile
{
public AutoMapperProfile()
{
CreateMap<StudentDTO, Student>()
.ForMember(dest => dest.City, opt => opt.MapFrom(src => src.CurrentCity));
CreateMap<AddressDTO, Address>();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment